package cn.flaty.views.web.users;

import java.util.Map;

import javax.annotation.Resource;
import javax.validation.Valid;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.flaty.services.user.entity.User;
import cn.flaty.services.user.service.UserBaseService;
import cn.flaty.services.user.vo.UserVo;
import cn.flaty.views.web.BaseController;


@Controller
@RequestMapping("/users")
public class UserCommentsController extends BaseController {

	/**
	 * 公用模块，所有本类控制器均会自动调用
	 * @author flatychen
	 * @date 2014-4-15
	 * @return
	 */
	@ModelAttribute
	public String commonAttributeTest(){
		return "commonAttributeTest";
	}
	
	/**
	 * 显示用户评论
	 * @author flatychen
	 * @date 2014-4-15
	 * @return
	 */
	@RequestMapping(value = "{userId}/comments/{commentId}/show", method = RequestMethod.GET)
	public String show(@PathVariable Map<String,String> pathArgs,Model model) {
		model.addAllAttributes(pathArgs);
		return "show";
	}

	/**
	 * 显示用户所有评论
	 * @author flatychen
	 * @date 2014-4-15
	 * @return
	 */
	@RequestMapping(value = "{userId}/comments/index", method = RequestMethod.GET)
	public String index(@PathVariable String userId) {
		return "index";
	}

	
}
